import { emits, props } from './OpSearch.vue';

// export const onKeypress = (e: KeyboardEvent) => {
//     if (e.key === 'Enter') {
//         e.preventDefault();
//         emits('search', props.modelValue);
//     }
// };

export const onKeypress = (e: KeyboardEvent) => {
    const ENTER_CODE = 13;
    if (e.keyCode === ENTER_CODE) {
        e.preventDefault();
        emits('search', props.modelValue);
    }
};
